package com.tyros.storage.modules.file.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 资源文件表
 *
 * @author zhangshuaiyin
 * @since 1.0.0 2022-02-19
 */
@Data
@ApiModel(value = "资源文件表")
@Accessors(chain = true)
public class FileDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "对外openId")
    private String openId;

    @ApiModelProperty(value = "文件名")
    private String name;

    @ApiModelProperty(value = "文件后缀")
    private String extension;

    @ApiModelProperty(value = "文件大小字节数，单位byte")
    private Long size;

    @ApiModelProperty(value = "文件md5值")
    private String md5;

    @ApiModelProperty(value = "文件SHA256值")
    private String sha256;

    @ApiModelProperty(value = "存储类型 1-本地 2-FastDFS")
    private Integer storageType;

    @ApiModelProperty(value = "存储路径")
    private String path;

    @ApiModelProperty(value = "ObjectKey")
    private String objectKey;

    @ApiModelProperty(value = "原始文件名")
    private String originalName;

    @ApiModelProperty(value = "逻辑删除字段 0-未删除 1-已删除")
    private Integer deleted;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime updateTime;

}
